﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.Generic;
using System.IO;

namespace SkyDriveConnector
{
    public interface IConnectorOperations
    {
        string AuthToken { get; set; }

        event EventHandler<EventArgs> SkyDriveItemsLoadingComplete;
        event EventHandler<EventArgs> SharePointItemsLoadingComplete;
        event EventHandler<EventArgs> AddSkyDriveFolderComplete;
        event EventHandler<EventArgs> AddSharePointFolderComplete;
        event EventHandler<EventArgs> AddSkyDriveItemComplete;
        event EventHandler<EventArgs> AddSharePointItemComplete;
        event EventHandler<EventArgs> DeleteSkyDriveItemComplete;
        event EventHandler<EventArgs> DeleteSharePointItemComplete;
        event EventHandler<ItemLoadingErrorEventArgs> SkyDriveItemLoadingOnError;
        event EventHandler<ItemLoadingErrorEventArgs> SharePointItemLoadingOnError;

        void GetItems(string Path, int CorrelationId);
        void GetSingleItem(string ItemId, int CorrelationId);
        void AddNewItem(string path, SkyDriveObject skydriveObject, int CorrelationId);
        void AddNewItem(string path, FileStream filestream, string filename, int CorrelationId);
        void CreateFolder(string path, string foldername, string description, int CorrelationId, string skydriveObjectId);
        void DeleteItem(string ItemId, int CorrelationId);       
        
    }

    public class ItemLoadingCompleteEventArgs<T> : EventArgs
    {
        public IEnumerable<T> Results { get; private set; }

        public int CorrelationId { get; private set; }
        public string Message { get; private set; }
        public string DeletedItemId { get; private set; }
        public ItemLoadingCompleteEventArgs(IEnumerable<T> results, int correlationId,string message, string deletedItemId)
        {
            Results = results;
            CorrelationId = correlationId;
            Message = message;
            DeletedItemId = deletedItemId;

        }

        

    }


    public class ItemLoadingErrorEventArgs : EventArgs
    {
        public string ErrorMessage{get; private set;}

        public ItemLoadingErrorEventArgs(string errorMessage)
        {
           ErrorMessage = errorMessage;
        }

    }



    
}
